package com.xjgz.aio.socket.pro.extension.plugins;

import com.xjgz.aio.socket.StateMachineEnum;
import com.xjgz.aio.socket.transport.AioSession;

import java.nio.channels.AsynchronousSocketChannel;

public abstract class AbstractPlugin<T> implements Plugin<T> {

    @Override
    public boolean preProcess(AioSession session, T t) {
        return true;
    }

    @Override
    public void stateEvent(StateMachineEnum stateMachineEnum, AioSession session, Throwable throwable) {

    }

    @Override
    public AsynchronousSocketChannel shouldAccept(AsynchronousSocketChannel channel) {
        return channel;
    }

    @Override
    public void afterRead(AioSession session, int readSize) {

    }

    @Override
    public void afterWrite(AioSession session, int writeSize) {

    }

    @Override
    public void beforeRead(AioSession session) {

    }

    @Override
    public void beforeWrite(AioSession session) {

    }
}
